package models

func BuildNodeData(nodeType, md5, stat string, id int64, data map[string]interface{}) NodeData {
	return NodeData{NodeType: nodeType, Id: id, Stat: stat, Md5: md5, Data: data}
}

func BuildOkMessage(uuid string, messageType string, data any) XMessage {
	return XMessage{Uuid: uuid, MessageType: messageType, MessageData: XMessageData{Code: 0, Message: "成功", Data: data}}
}

func BuildFailMessage(uuid string, messageType string, message string) XMessage {
	return XMessage{Uuid: uuid, MessageType: messageType, MessageData: XMessageData{Code: -1, Message: message, Data: nil}}
}

func BuildEncode(column *SerialMetaColumn, excelRow *ExcelData) SerialHandleCtx {
	return SerialHandleCtx{Column: column, ExcelRow: excelRow}
}

func BuildDecode(column *SerialMetaColumn, dbRow *NodeData) SerialHandleCtx {
	return SerialHandleCtx{Column: column, DbRow: dbRow}
}
